﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true" CodeFile="Marcas.aspx.cs" Inherits="Marcas" %>

<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 80%;">
    <tr>
    <td>
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSourcemarcas" KeyFieldName="AMA_ID" Theme="PlasticBlue" 
            Width="80%">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0" Caption="Opciones">
                <EditButton Visible="True">
                </EditButton>
                <NewButton Visible="True">
                </NewButton>
                <DeleteButton Visible="True">
                </DeleteButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn FieldName="AMA_ID" ReadOnly="True" VisibleIndex="1" 
                Caption="Id">
                <EditFormSettings Visible="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="AMA_NOMBRE" VisibleIndex="2" 
                Caption="Nombre">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <Settings ShowFilterRow="True" />
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlDataSourcemarcas" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>" 
        DeleteCommand="DELETE FROM [AUT_MARCAS] WHERE [AMA_ID] = @AMA_ID" 
        InsertCommand="INSERT INTO [AUT_MARCAS] ([AMA_NOMBRE]) VALUES (@AMA_NOMBRE)" 
        SelectCommand="SELECT * FROM [AUT_MARCAS]" 
        UpdateCommand="UPDATE [AUT_MARCAS] SET [AMA_NOMBRE] = @AMA_NOMBRE WHERE [AMA_ID] = @AMA_ID">
        <DeleteParameters>
            <asp:Parameter Name="AMA_ID" Type="Decimal" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="AMA_NOMBRE" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="AMA_NOMBRE" Type="String" />
            <asp:Parameter Name="AMA_ID" Type="Decimal" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <dx:ASPxButton ID="btnExportarExcel" runat="server" 
        onclick="btnExportarExcel_Click" Text="Exportar Excel">
    </dx:ASPxButton>
    <dx:ASPxGridViewExporter ID="ASPxGridViewExporterMarcas" runat="server">
    </dx:ASPxGridViewExporter>
    </td>
    </tr>
    </table>
</asp:Content>

